package com.zhouyu.mysql.lock;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Objects;

/**
 * 大都督周瑜（我的微信: dadudu6789）
 */
@Data
@AllArgsConstructor
public class RecId {
    private int spaceId;
    private int pageNo;
    private int heapNo;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RecId recId = (RecId) o;
        return spaceId == recId.spaceId && pageNo == recId.pageNo && heapNo == recId.heapNo;
    }

    @Override
    public int hashCode() {
        return Objects.hash(spaceId, pageNo, heapNo);
    }
}
